

function sleep(time){
  return new Promise((resolve,reject)=>{
    setTimeout(function(){
      resolve(time);
    },time)
  });
}

async function test(){
  let r= await sleep(5000);
  console.log(r);

  r= await sleep(4000);
  console.log(4000);

  r= await sleep(3000);
  console.log(3000);

  r= await sleep(2000);
  console.log(2000);

  r= await sleep(1000);
  console.log(1000);

  return r;
}

test();
